﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraBars.Ribbon;

namespace td.Core
{
    public abstract class AbstractViewContent : td.Core.IViewContent, IDisposable
    {
        public event EventHandler TitleChanged;
        private  string title=null;
        public abstract XtraUserControl ViewContentControl { get; }

        public AbstractViewContent()
        {
            this.title = "无标题";
        }
        public AbstractViewContent(string title)
        {
            this.title = title;
        }
        protected virtual void OnTitleChanged(EventArgs e)
        {
            if (this.TitleChanged != null)
            {
                this.TitleChanged(this, e);
            }
        }

        public virtual string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                if (!this.title.Equals(value))
                {
                    this.title = value;
                    this.OnTitleChanged(EventArgs.Empty);
                }
            }
        }

        public void Dispose()
        {
           // throw new NotImplementedException();
        }
    }
}
